﻿<html>
<head>
    <title>News - Options</title>

    <script language="javascript" type="text/javascript" src="js/jquery-1.6.2.min.js"></script>

    <style>
        body
        {
            font-family: helvetica, arial, sans-serif;
            font-size: 80%;
            margin: 10px;
        }
        #header
        {
            padding-bottom: 1.5em;
            padding-top: 1.5em;
        }
        #header h1
        {
            font-size: 156%;
            display: inline;
            padding-bottom: 43px;
            padding-left: 75px;
            padding-top: 40px;
            background: url(Yallakora-logo.gif) no-repeat;
            background-size: 67px;
            background-position: 1px 18px;
        }
        .section-header
        {
            background: #ebeff9;
            border-top: 1px solid #b5c7de;
            font-size: 99%;
            padding: 3px 0 2px 5px;
            font-weight: bold;
            margin-bottom: 1em;
            margin-top: 4em;
        }
        .section-header.first
        {
            margin-top: 1em;
        }
        #custom-domain
        {
            width: 300px;
            margin-left: 2px;
        }
        #footer
        {
            margin-top: 4em;
        }
    </style>

    <script type="text/javascript">
        $(document).ready(function() {
            var bk = chrome.extension.getBackgroundPage();
            $('#ModuleName').text(bk.ModuleNameOptions);
        });
    </script>

</head>
<body>
    <div id="header">
        <h1 id="ModuleName">
            Options</h1>
    </div>
    <div class="section-header first">
        Custom Notifications</div>
    <p>
        
        <p>
            <input id="chkShowNotif" type="checkbox" onchange="markDirty()"  /> Show Notifications 
            <div id="footer">
                <button id="save-button" style="font-weight: bold" onclick="save()">
                    Save</button>
                <button onclick="init()">
                    Cancel</button>
            </div>

            <script>
                var customDomainsTextbox;
                var saveButton;

                init();
                function init() {
                    saveButton = document.getElementById("save-button");
                    var optShowNotifications = localStorage["optShowNotifications"]
                    if (optShowNotifications == '1')
                        $('#chkShowNotif').attr("checked", "checked");
                    else
                        $('#chkShowNotif').removeAttr("checked");
                    markClean();
                }

                function save() {
                    if($('#chkShowNotif').is(':checked')){
                        localStorage["optShowNotifications"]='1';
                    }else{
                        localStorage["optShowNotifications"]='0';
                    }
                    markClean();
                    chrome.extension.getBackgroundPage().init();
                }

                function markDirty() {
                    saveButton.disabled = false;
                }

                function markClean() {
                    saveButton.disabled = true;
                }
            </script>
</body>
</html>
